//
//  CommentViewCell.m
//  coba-iOS
//
//  Created by 郭四虎 on 15/11/18.
//  Copyright © 2015年 YouKu. All rights reserved.
//

#import "CommentViewCell.h"

@implementation CommentViewCell

- (void)awakeFromNib {
    // Initialization code
    [super awakeFromNib];
}
- (IBAction)upClick:(UIButton *)sender {
    if (sender.selected) {
        
        [self Message:@"已经赞过" HiddenAfterDelay:1];
        
    }else{
        self.updown();
    }
}

- (void)showModel:(CommentModel *)model
{
    self.titleLb.text = model.title;
    self.dateLb.text = model.date;
    self.authorLb.text = [NSString stringWithFormat:@"作者：%@", model.name];
    self.upLb.text = model.up_num;
    self.replyLb.text = model.reply_num;
    
 //   NSString *url = [NSString stringWithFormat:@"%@?url=%@",GETICON,model.icon];
    [self.iconIma sd_setImageWithURL:[NSURL URLWithString:model.icon] placeholderImage:[UIImage imageNamed:@"酷吧LOGO_meitu_1"]];
    
    if (model.is_up) {
        if (model.is_up.integerValue > 0) {
            self.upBtn.selected = YES;
        }else{
            self.upBtn.selected = NO;
        }
    }
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
